<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <base href="<%=basePath%>">
    
    <title>校园登录管理系统</title>
    <%
	// 权限验证
	if(session.getAttribute("currentUser")==null){
		System.out.println("滚");
		response.sendRedirect("index.jsp");
		return;
	}
%>
	<link rel="stylesheet" type="text/css" href="com/jspframework/jquery-easyui-1.5.1/themes/default/easyui.css">
	<link rel="stylesheet" type="text/css" href="com/jspframework/jquery-easyui-1.5.1/themes/icon.css">
	<link rel="stylesheet" type="text/css" href="com/jspframework/jquery-easyui-1.5.1/demo.css">
	<script type="text/javascript" src="com/jspframework/jquery-easyui-1.5.1/jquery.min.js"></script>
	<script type="text/javascript" src="com/jspframework/jquery-easyui-1.5.1/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="com/jspframework/jquery-easyui-1.5.1/locale/easyui-lang-zh_CN.js"></script>
  </head>
  
  <script type="text/javascript">
	$(function(){
		// 数据

			var treeData = [ {
					text : "学校",
					children : [ {
						text : "中学信息管理",
						children : [ {
							text : "贵港高级中学",
							attributes : {
								url : ""
							},
							children : [ {
								text : "年级信息管理",
								attributes : {
									url : ""
								},
								children : [ {
									text : "一年级信息管理",
									attributes : {
										url : ""
									},
									children : [{
									text : "0716班",
									attributes : {
										url : ""
									}},
									{
									text : "0717班",
									attributes : {
										url : ""
									}}
									]
								},{
									text : "二年级信息管理",
									attributes : {
										url : ""
									}
								},{
									text : "三年级信息管理",
									attributes : {
										url : ""
									}
								} ]
							} ]
						}, {
							text : "达开高级中学",
							attributes : {
								url : ""
							},
							children : [ {
								text : "班级信息管理",
								attributes : {
									url : ""
								},
								children : [ {
									text : "学生信息管理",
									attributes : {
										url : ""
									}
								} ]
							} ]
						}, {
							text : "江南高级中学",
							attributes : {
								url : ""
							},
							children : [ {
								text : "班级信息管理",
								attributes : {
									url : ""
								},
								children : [ {
									text : "学生信息管理",
									attributes : {
										url : ""
									}
								} ]
							} ]
						} ]
					} ]
				} ];

				// 实例化树菜单
				$("#tree").tree({
					data : treeData,
					lines : true,
					onClick : function(node) {
						if (node.attributes) {
							openTab(node.text, node.attributes.url);
						}
					}
				});

				// 新增Tab
				function openTab(text, url) {
					if ($("#tabs").tabs('exists', text)) {//防止出现多个tab页
						$("#tabs").tabs('select', text);//跳转到对应页
					} else {//没有才新增
						var content = "<iframe frameborder='0' scrolling='auto' style='width:100%;height:100%' src="
								+ url + "></iframe>";
						$("#tabs").tabs('add', {
							title : text,
							closable : true,
							content : content
						});
					}
				}
			});
		</script>
</head>

<body class="easyui-layout">
	<div region="north" style="height: 80px;background-color: #E0EDFF">
		<div align="left" style="width: 80%;float: left"></div>
		<div style="padding-top: 50px;padding-right: 20px;">当前用户：&nbsp;<font color="red" >${currentUser}</font></div>
		</div>
	</div>
	<div region="center">
		<div class="easyui-tabs" fit="true" border="false" id="tabs">
			<div title="首页" >
				<div align="center" style="padding-top: 100px;"><font color="red" size="10">欢迎使用</font></div>
			</div>
		</div>
	</div>
	<div region="west" style="width: 150px;" title="导航菜单" split="true">
		<ul id="tree"></ul>
	</div>
	<div region="south" style="height: 25px;" align="center">版权所有<a href="http://www.ganhx.com">www.ganhx.com</a></div>
</body>
</html>
